package com.ruoyi.web.controller.ppt;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.ppt.domain.vo.PptTemplateVO;
import com.ruoyi.ppt.service.PptContentService;
import com.ruoyi.ppt.service.PptTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 李志鑫
 * @since 2024-07-03
 */
@RestController
@RequestMapping("/pptTemplate")
@Api(tags = "ppt-ppt模板首页-ppt内容")
public class PptTemplateController {

    @Autowired
    private PptTemplateService pptTemplateService;
    @Autowired
    private PptContentService pptContentService;


    @GetMapping("/list")
    @ApiOperation(value = "模板首页", notes = "模板首页")
    public AjaxResult list(Integer pageNum, Integer pageSize, Integer templateType,String message) {
        return pptTemplateService.selectList(pageNum,pageSize,templateType,message);
    }

    @GetMapping("/list/id")
    @ApiOperation(value = "ppt内容查询", notes = "ppt内容查询")
    public AjaxResult listId(Integer id) {
        return pptContentService.listId(id);
    }

    @PostMapping("/addPpt")
    @ApiOperation(value = "上传ppt", notes = "上传ppt")
    public AjaxResult addPpt(@RequestBody PptTemplateVO pptTemplateVO) {
        return pptTemplateService.addPpt(pptTemplateVO);
    }







}

